import java.util.LinkedList;

class Main {

    private static final int SIZE = 80;

    public static void main(String[] args) {
        HashTable ht = new HashTable();
        for (int i = 1; i <= SIZE; i++) {
            Student stu = new Student(i, getName(i), i % 3 == 0 ? "1999" : i % 3 == 1 ? "1997" : "1998", i % 2 == 0 ? "Man" : "Woman");
            ht.put(stu);
        }

        ht.delete(20);
        for (int i = 1; i <= SIZE; i++) {
            Student student = ht.get(i);
            if (student != null) {
                System.out.println(student);
            }
        }
        System.out.println("\n————————————华丽丽的分割线————————————————\n");

        /**
         * LRU 进阶
         *
         * 本来是按顺序存进去的。现在输出是倒序的
         */
        for (LinkedList<Student> linkedList : ht.getArray()) {
            for (Student stu : linkedList) {
                System.out.println(stu);
            }
            System.out.println("————————");
        }

    }

    public static String getName(int i) {
        switch (i % 5) {
            case 0:
                return "张三";
            case 1:
                return "李四";
            case 2:
                return "王五";
            case 3:
                return "阿猫";
            case 4:
                return "阿狗";
            default:
                return "三迟但到";
        }
    }
}